Quantum legitimacy of reversible gate and a new design of multiplier based on R gate
Ge Tingyu, Zhang Tinggui, Huang Xiaofen
School of Mathematics and Statistics, Hainan Normal University, Haikou 571158, China

 

† Corresponding author. E-mail: tinggui333@163.com

Project supported by the National Natural Science Foundation of China (Grant No. 11861031).

Abstract

Quantum full adders play a key role in the design of quantum computers. The efficiency of a quantum adder directly determines the speed of the quantum computer, and its complexity is closely related to the difficulty and the cost of building a quantum computer. The existed full adder based on R gate is a great design but it is not suitable to construct a quantum multiplier. We show the quantum legitimacy of some common reversible gates, then use R gate to propose a new design of a quantum full adder. We utilize the new designed quantum full adder to optimize the quantum multiplier which is based on R gate. It is shown that the new designed one can be optimized by a local optimization rule so that it will have lower quantum cost than before.

1. Introduction

Quantum computers have far more computing power than classical computers. This is because of the properties called quantum parallel operation. Plenty of questions cannot be solved with a classical computer because it will cost ridiculous resources. Quantum computer can solve some of these problems because of quantum parallel operation. Based on this properties, a lot of quantum algorithms have been designed. Grover’s search algorithm[1] and Shor’s factorization algorithm are included.[2] Since quantum computers are based on quantum gates and all quantum gates are reversible, the research of reversible gates plays an important role in quantum computers.

The research of reversible gates is an important branch of basis mathematics. The reason why reversible gates were the first choice is that it does not consume any energy in theory. Based on Landauer’s principles,[3] if a computation could be done reversibly, then the energy consumed can be zero. Since a reversible gate maps each input vector to an output vector uniquely and vice versa,[4] that means a reversible computation does not erase any information, it does not cost any energy. Besides the application in quantum computer, reversible gates are also widely used in other fields, such as low power CMOS systems,[5] optical computing,[6] DNA computing,[7] and nanotechnology.[8] It is very clear that the research of reversible gates will provide a solid theoretical basis for fundamentals and applications.

Arithmetic adders and multipliers are the fundamental component in computational units. It is clear that adders and multipliers are the fundamental of a classical computer. As a result, quantum adders and multipliers should be designed to build perfect quantum computers. However, it lies a question: classical adders and multipliers are irreversible (most classical logic gates are irreversible such as AND and OR), hence they cannot be used directly in quantum computers. Thus, quantum arithmetic operations must be built from reversible gates.[9] Based on this idea, lots of reversible adders and multipliers using different reversible gates have been proposed. A design of reversible full adders using two RG gates is introduced in Ref. [10]. Thersesal et al.[11] have proposed a new reversible gate called NR gate, then used this gate to construct a full adder and a subtractor. Thapilyal et al.[12] used TR gate to build a full adder, and it has been optimized. Islam et al.[13] have proposed a full adder with two P gates, and the quantum cost has been optimized by Banerjee et al.[14] A new reversible gate was introduced in Ref. [15], then it has been used to made a full adder and a subtractor.[16]

In this paper, we focus on the quantum legitimacy of main reversible gates and a new design of multiplier using R gate. We are going to show the quantum legitimacy of N, C, T, P and R gates. Then we propose a new design of a full adder using R gate. We show that when we use the new full adder to build a multiplier, our new designed multiplier has absolute advantage than using the existed full adder based on R gate, and our design has the lowest garbage bit and quantum cost, then we explain the advantages of using R gate to build quantum Arithmetic operations. The chapters are distributed as follows: In Section 2, we introduce some definitions and facts which will be referred in this paper. Section 3 lists some reversible gates, and shows the quantum legitimacy of these reversible gates. In Section 4, we propose a new design of a full adder, then build a multiplier with it. In Section 5, we give conclusions and compare our designs with relevant designs proposed by others.

2. Definitions and fact

First, we recall some basic concepts and facts.

3. Common reversible gates and quantum legitimacy

There are many reversible gates, and these gates can used to construct lots of circuits. In this section we introduce some common reversible gates and show the matrix of them, so that these reversible gates can be used as quantum gates, which means that circuits based on these gates are also suitable for quantum computers.

The NOT gate (N) is a one-bit gate, it flips the input bits unconditionally. The quantum cost of NOT gate is zero. it is trivial that for a 1 × 1 reversible circuit, there is only one NOT gate. In quantum computation, it is called the Pauli matrix, and it can be represented by matrix .

The controlled-NOT gate or CNOT gate is a reversible gate, and also a two-qubit quantum gate. The quantum cost of CNOT gate is one. It is easy to see that there are two possible CNOT gates for a 2×2 circuit. The action of the CNOT gate is given by |c〉|t〉→ |c〉|ct〉, that is, if the control qubit is set to |1〉, then the target qubit will be flipped, otherwise the target qubit will be let alone. Thus, the matrix representation of CNOT are

The Toffoli gate (T) is a 3 × 3 reversible gate, and also a three-qubit quantum gate. The quantum cost of Toffoli gate is five. There are three possible Toffoli gates for a 3 × 3 circuit. The circuit representation is shown in Fig. 1. The action of the Toffoli gate is given by |a〉|b〉|c〉→ |ab〉⊕ c〉, that is, if the control qubit |x〉 and |y〉 are set to |1〉 at the same time, then the target qubit will be flipped, otherwise the target qubit will be let alone. Thus, the matrix representation of Toffoli gates are

Fig. 1. The Toffoli gate: (a) T(2,3,1), (b) T(1,3,2), and (c) T(1,2,3).

The Fredkin gate (F) is a 3 × 3 reversible gate, and also a three-qubit quantum gate. The quantum cost of Fredkin gate is five, which was optimized in Ref. [22]. There are three possible Fredkin gates for a 3 × 3 circuit. The circuit representation is shown in Fig. 2. The action of the Fredkin gate is that, if the control qubit |x〉 is set to |1〉, then swap the values of the other two qubits, otherwise the gate will do nothing. Thus, the matrix representations of Fredkin gates are

Fig. 2. The Fredkin gate: (a) F(1,2,3), (b) F(3,1,2), and (c) F(2,1,3).

The Rn gate is an n-qubit universal reversible gate, we can make a universal gate library only used Rn gate. It was first introduced in Ref. [15] and used to construct a full adder/substractor in Ref. [16]. It combines the functionality of the NOT gate, the CNOT gate and the Toffoli gate. We will make a multiplier using R3 gate, so we introduce R1, R2 and R3 only.

The R1 gate is just like NOT gate, it is a 1 × 1 gate, and flips the input qubit unconditionally. The quantum cost of R1 gate is zero.

The R2 gate is a combine of NOT gate and CNOT gate. If the control qubit is set to |1〉 then the target qubit is flipped, otherwise the target qubit is let alone, then flips the control qubit unconditionally. The quantum cost of R2 gate is one. There are two possible R2 gate for a 2 × 2 circuit. Figure 3 shows the circuit representation. It can be represented by

Thus R2 gate is a quantum gate.

Fig. 3. The R2 gate: (a) R(1,2) and (b) R(2,1).

The R3 gate is a three-qubit gate, the function of this gate can be described as follows: firstly use |x〉 and |y〉 as control bits to flip |z〉. Secondly |x〉 is used as a control bit to flip |y〉, then flips |z〉 unconditionally. Finally use |z〉 as control bit to flip |x〉. The quantum cost of R3 gate can be optimized to four with moving rules.[23][24] There are six possible R3 gates for a 3 × 3 circuit. Figure 4 shows the circuit representation and figure 5 shows the optimization process. It is easy to calculate the matrix corresponding to each R3 gate, we list the calculation results in the following:

As a result, R3 gate is a quantum gate.

Fig. 4. The R3 gate: (a) R(3,1,2), (b) R(1,3,2). We do not list all representations of R3 gate, the others are similar to these two examples.
Fig. 5. The optimization process.
4. Proposed multiplier

In this section, we propose three new designs, which are a half adder, a full adder and a multiplier, designed using R gate.

The half adder can be used to calculate the operation S = X + Y and to carry out bit C. The combination of R3(3,1,2) and R2(2,1) can do this. We use three input qubits, i.e.,|x〉, |y〉, which is the target value, and a constant qubit |0〉. We can obtain three output qubits, the first one is the summation bit Si, the second one is a garbage bit, and the third one is the carry out bit Ci. The quantum cost of our half adder is four. Figure 6 shows the proposed half adder.

Fig. 6. The half adder using R gate.

Using this half adder, we can make a full adder. Figure 7 shows the full adder. This design uses two half adders and one constant bit to produce two garbage bit, the quantum cost of this full adder is six. Figure 8 shows the optimized process.

Fig. 7. The full adder using R gate.
Fig. 8. The optimization process.

Now we can apply our half adder and full adder to build a multiplier. A multiplier consists of a partial product generator circuit (PPCG) and a reversible parallel adder (RPA), we use the partial product generator circuit proposed in Ref. [14], then give the structure of an array multiplier in Fig. 9.

Fig. 9. RPA circuit.

It should be noted that the PPCG proposed in Ref. [14] uses only Toffoli gate, whereas we choose R gate library instead of NCT gate. This means that we need more R gate to synthesize a Toffoli gate in order to use this PPCG. However, it is worth. On the one hand, this circuit produces the lowest garbage bit, which is of great importance in a quantum computer. On the other hand, based on the view of Ref. [14] more quantum gates do not means more quantum cost. After simplification, we use the same numbers of N, V and U gates, which mean that in actual use, they do not make any difference, as a result, the gate number is out of consideration in this paper.

Finally, we compare our designs with the previous work in Tables 1 and 2. Table 1 shows the comparison of different full adders, and Table 2 shows the comparison of different multipliers. It is easy to see from Table 1 that our design has lower quantum cost than the existing design using R gate,[16] and have the same garbage bit and quantum cost as the existing design,[14] which means that it is the best design. From Table 2, we can see that our design is better than using the full adder proposed in Ref. [16] and has the lowest total cost.

Table 1.

Comparison of the full adder.

.
Table 2.

Comparison of full adder.

.
5. Conclusions and discussion

We have shown the quantum legitimacy of some common reversible gate and given a new design of multiplier. It is very meaningful to show the quantum legitimacy of reversible gates. The difference between a reversible gate and a quantum gate is that a reversible use takes zero or one as the input while a quantum gate takes vector |0〉 and |1〉 as the input. However, giving a matrix representation to a reversible gate means that it can deal with a vector input, which means that many results based on reversible gates can be applied to quantum computer directly, and promote the research and development of related interdisciplinary subjects.

Our designs use local optimization rule in order to achieve the limit optimization of quantum cost and garbage bit, in this point it is similar to the existing design. However, compared with existed designs, our designs have lots of differences and advantages. The most obvious thing is that we use a new library. Our new designs are based on R gate library. R gate library is better than other gate libraries in many ways such as the size of minimal universal sub libraries, utilization of gate, the minimal length and so on. As a result, under the same condition, R gate library is a better choice than NCT gate libraries. However, as shown in Table 2, the multiplier using the previous adders is not optimal. Our designs make up for its defects in the multiplier part, and make the R gate library more advantageous in theoretical research and practical use. Moreover, our design pays more attention to the optimization of garbage bit, although it uses a little more gates, but it is worth. Regarding the comparison between our designs and the previous results, we have carried out a detailed analysis in Tables 1 and 2.

Reference
[1] Grover L K 1997 Phys. Rev. Lett. 79 325
[2] Shor P W 1999 Siam Rev. 41 303
[3] Landauer R 1961 IBM J. Res. Dev. 5 183
[4] Das K De D 2010 Int. J. Nanosci. 09 201
[5] Chee Y H Niknejad A M Rabaey J 2006 IEEE J. Solid-State Circuits 41 1740
[6] Shamir J Caulfield H J Micelli W J Seymour R J 1986 Appl. Opt. 25 1604
[7] Cervantes-Salido V M Jaime O Brizuela C A Israel M Pérez M 2013 Appl. Soft Comput. 13 4594
[8] Zhang J Albelda M T Liu Y Canary J W 2005 Chirality 17 404
[9] Ritter S N Lleke C Hahn C Reiserer A Neuzner A Uphoff M Mücke M Figueroa E Bochmann J Rempe G 2012 Nature 484 195
[10] Ni L Guan Z Zhu W 2010 Third International Symposium on Intelligent Information Technology and Security Informatics April 2–4, 2010 Jinggangshan, China 109 113 10.1109/IITSI.2010.25
[11] Thersesal T Sathish K Aswinkumor R 2015 Int. J. Sci. Res. Publ. 5 1
[12] Rangaraju H G Venugopal U Muralidhara K N Raja K B 2010 International Conference on Advances in Communication, Network, and Computing Berlin Springer 10.1007/978-3-642-19542-6_14
[13] Islam M S Islam M R 2005 Asian J. Inf. Technol. 4 1146
[14] Banerjee A Pathak A 2009 arXiv: 0907.3357.1
[15] Montaser R Younes A Abdelaty M 2017 Quantum Matter 2017 1403
[16] Montaser R Younes A Abdel-Aty M 2019 Int. J. Theor. Phys. 58 167
[17] Morrison M Lewandowski M Meana R Ranganathan N 2011 11th IEEE International Conference on Nanotechnology August 15–18, 2011 Portland, OR, USA 417 420 10.1109/NANO.2011.6144407
[18] Miller D M Sasanian Z 2010 53rd IEEE International Midwest Symposium on Circuits and Systems August 1–4, 2010 Seattle, WA, USA 260 263 10.1109/MWSCAS.2010.5548653
[19] Bhuvana B P Bhaaskaran V S K 2018 Quantum Cost Optimization of Reversible Adder/Subtractor Using a Novel Reversible Gate in Innovations in Electronics and Communication Engineering. Lecture Notes in Networks and Systems Saini H Singh R Reddy K 7 Singapore Springer 10.1007/978-981-10-3812-9_12
[20] Rahman M M Banerjee A Dueck G W Pathak A 2011 41st IEEE International Symposium on Multiple-Valued Logic May 23–25, 2011 Tuusula, Finland 86 92 10.1109/ISMVL.2011.56
[21] Nielsen M A Chuang I L 2011 Quantum Computation and Quantum Information 10 Cambridge Cambridge University Press
[22] Patel R B Ho J Ferreyrol F Ralph T C Pryde G J 2016 Sci. Adv. 2 1501531
[23] Iwama K Yamashita S 2003 New Generation Comput. 21 297
[24] Miller D M Maslov D Dueck G W 2003 Transformation Based Algorithm for Reversible Logic Synthesis New York Association for Computing Machinery 318